#!/bin/sh

# This script runs when init it run during the boot process.
# Mounts everything in the fstab

mount -a
#mount -o remount +w /

#
# Mount the RAM filesystem to /tmp
#

mount -t ramfs -n none /tmp
mount -t ramfs -n none /var
mount -t ramfs -n none /config

#
# Set lo eth1 up
#

ifconfig lo 127.0.0.1 up
#ifconfig eth2 up

# /etc/rc.d/network_config.sh
#ifconfig eth1 up

#
# insert netfilter/iptables modules
#

/etc/rc.d/rc.modules

#
# when disable nas, we need this to login
#
echo 'root:x:0:0:root:/root:/bin/sh' > /tmp/passwd

#
# Start Our Router Program
# 
#set a temporary MAC address, from file raether.c
ifconfig eth2 hw ether 00:00:04:43:28:10
ifconfig eth2 up
brctl addbr br0
ifconfig br0 up
brctl setfd br0 0
brctl addif br0 eth2
#ifconfig br0 192.168.0.254

echo 1105920 > /proc/sys/net/core/wmem_max
echo 1105920 > /proc/sys/net/core/wmem_default 

/usr/bin/uclited
/usr/bin/httpd &

/etc/rc.d/rc.init

echo 524288 > /proc/sys/net/ipv4/ipfrag_high_thresh

#dhcp6c -c /tmp/dhcp6c.conf br0
